<script>
	
	global.isLogin = function(){
		try{
			var suid = uni.getStorageSync('suid');
			var srand = uni.getStorageSync('srand');
		}catch(e){
			//TODO handle the exception
		}
		if(suid==''){
			return false;
		}else{
			return [suid,srand];
		}
	};
	export default {
		data(){ 
			return{
				name:"",
				city:"",
				gender:""
			}
		},
		onLaunch: function() {
			var that = this;
			console.log('App Launch')
			uni.login({
			      success: res_login => {
			
			      console.log('-------获取code-------')
			      console.log(res_login.code);
			              uni.getUserInfo({
			                     success: info => {
			
			                               console.log('-------获取sessionKey、openid(unionid)-------')
			                               console.log(info);
											that.name=info.userInfo.nickName;
											that.city = info.userInfo.city;
											that.gender = info.userInfo.gender;
											console.log(that.name,that.city,that.gender)
			                     }
			              });
			      }
			});
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		onTabItemTap:function(item){
			console.log(item);
		}
		
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import 'uview-ui/theme.scss';
</style>
